﻿<!DOCTYPE html>
<!--隐患排查情况查询-->
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

    <link href="../static/js/vue-treeselect/vue-treeselect.css" rel="stylesheet" />
    <script src="../static/js/vue-treeselect/vue-treeselect.js"></script>
    <style>
        .vue-treeselect__control {
            height: 100%;
            border: none;
            background: none;
        }

        .vue-treeselect__placeholder {
            top: -3px;
        }

        .vue-treeselect__single-value {
            top: -3px;
        }


    </style>
</head>

<body>
    <div id="app" v-cloak class="popupW100">

        <el-form label-position="right" ref="form" :inline="true" :model="formInline" class="demo-form-inline"
                 style="margin-bottom: 15px;">
           
            <el-row>
                <el-col class="head-tool">
                        
<div class="new_title fl"><strong><img src="/static/images/icon1.png" />隐患排查情况查询列表</strong></div>

                    <span>
                        <btn :text="col.btnSelect" imgsrc="/static/images/search.png" linetype="4"
                            @click="onSubmit"></btn>
                       
                    </span>
                </el-col>
            </el-row>
            <el-row>

                <el-col :xs="12" :sm="8" :md="6" :lg="6" :xl="6">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input v-model="formInline.model.Unit" :placeholder="RisksManagement.RiskContent.Unit"
                                      size="mini">
                                <template slot="prepend">
                                    {{RisksManagement.RiskContent.Unit+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>

                <el-col :xs="12" :sm="8" :md="6" :lg="6" :xl="6">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input v-model="formInline.model.Objective"
                                      :placeholder="RisksManagement.RiskContent.Objective" size="mini">
                                <template slot="prepend">
                                    {{RisksManagement.RiskContent.Objective+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>


                <el-col :xs="12" :sm="8" :md="6" :lg="6" :xl="6">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input size="mini">
                                <template slot="prepend">
                                    {{RisksManagement.RiskCheckSituationSel.CheckTime+'开始'+mark.m}}
                                </template>
                                <el-date-picker v-model="formInline.model.CheckTimeBegin"
                                                type="date"
                                                slot="suffix"
                                                size="mini"
                                                placeholder="选择日期">
                                </el-date-picker>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :xs="12" :sm="8" :md="6" :lg="6" :xl="6">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input size="mini">
                                <template slot="prepend">
                                    {{RisksManagement.RiskCheckSituationSel.CheckTime+'结束'+mark.m}}
                                </template>
                                <el-date-picker v-model="formInline.model.CheckTimeEnd"
                                                type="date"
                                                slot="suffix"
                                                size="mini"
                                                placeholder="选择日期">
                                </el-date-picker>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :xs="12" :sm="8" :md="6" :lg="6" :xl="6">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input size="mini">
                                <template slot="prepend">
                                    {{RisksManagement.RiskContent.PersonInCharge+mark.m}}
                                </template>
                                <treeselect v-model="formInline.model.PersonInCharge" :options="PersonInCharge" :flat="true"
                                            :show-count="true" :disable-branch-nodes="true" slot="suffix" placeholder="请选择"
                                            style="line-height: 28px;width: 74%;float: right;" />
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
            </el-row>
        </el-form>


        <el-col :span="24">
            <el-table stripe ref="table" :data="ListItem.tableData" :height="ListItem.tableHeight" border
                      @selection-change="handleSelectionChange" row-style="height:10px" style="width: 100%">
                <!--:span-method="objectSpanMethod"-->
                <!--<el-table-column type="selection" align="center" width="55">
                </el-table-column>-->
                <el-table-column type="index" :label="RisksManagement.RiskContent.id" width="50" show-overflow-tooltip="true" :index="indexMethod">
                </el-table-column>
                <el-table-column prop="Unit" :label="RisksManagement.RiskContent.Unit" min-width="200" show-overflow-tooltip="true">
                </el-table-column>
                <el-table-column prop="Objective" :label="RisksManagement.RiskContent.Objective" min-width="200" show-overflow-tooltip="true">
                </el-table-column>
                <el-table-column prop="PersonInCharge" :formatter="getDicValue" min-width="100" show-overflow-tooltip="true"
                                 :label="RisksManagement.RiskContent.PersonInCharge">
                </el-table-column>
                <!--<el-table-column prop="Participant" :formatter="getDicValue"
                     :label="RisksManagement.RiskContent.Participant">
                </el-table-column>-->

                <el-table-column prop="FrequencyText" :label="RisksManagement.RiskContent.Frequency" show-overflow-tooltip="true">
                </el-table-column>

                <el-table-column prop="aRegion" :label="RisksManagement.RiskCheckSituationSel.CheckArea" show-overflow-tooltip="true">
                </el-table-column>
                <el-table-column prop="aProject" :label="RisksManagement.RiskCheckSituationSel.CheckProject" show-overflow-tooltip="true">
                </el-table-column>
                <el-table-column prop="aPerson" :label="RisksManagement.RiskCheckSituationSel.Reporter" min-width="80" show-overflow-tooltip="true">
                </el-table-column>
                <el-table-column prop="aTime" :label="RisksManagement.RiskCheckSituationSel.ReportTime" min-width="100" show-overflow-tooltip="true">
                </el-table-column>

                <!--<el-table-column prop="Requirements" :label="RisksManagement.RiskContent.Requirements">
                </el-table-column>
                <el-table-column prop="Content" :label="RisksManagement.RiskContent.Content">
                </el-table-column>-->
                <!--<el-table-column width="53" prop="update" :label="col.btnUpdate" fixed="right">
                    <template slot-scope="scope">
                        <button type="button" class="elst-bt-xg" @click=UserInput('xg',scope.row.id)>
                            <i class="el-icon-edit"></i>
                        </button>
                    </template>
                </el-table-column>-->
            </el-table>
            <el-row type="flex" justify="end">


                <el-pagination ref="page" @size-change="handleSizeChange" @current-change="handleCurrentChange"
                               :current-page="ListItem.currentPage" :page-sizes="ListItem.pagesizes" :page-size="ListItem.pagesize"
                               :layout="ListItem.layout" :total="ListItem.total">
                </el-pagination>

            </el-row>
        </el-col>

        <!--:fullscreen="true"-->
    </div>
    <script type="text/javascript">
        Vue.component('treeselect', VueTreeselect.Treeselect)
        app = new Vue({
            el: '#app',
            data: function () {
                return {
                    mydata: PersonInChargeTree,
                    defaultProps: {
                        children: 'children',
                        label: 'label'
                    },
                    //页面内数据初始化
                    ListItem: ListItem,
                    formInline: {
                        model: {
                            Unit: '',
                            Objective: '',
                            PersonInCharge: null,
                            Participant: '',
                            Content: '',
                        },
                        offset: 0,
                        limit: 10
                    },
                    PersonInCharge: []
                }
            },
            created: function () {
                var currApp = this;
                window.onresize = function () {
                    currApp.ListItem.tableHeight = window.innerHeight -
                        currApp.$refs.table.$el.offsetTop - 60;
                    if (currApp.ListItem.tableHeight < 112) {
                        currApp.ListItem.tableHeight = 112;
                    }

                }
            },
            mounted: function () {

                //初始化数据
                this.GetPageData(1);
                //列表高度自适应
                tablehigh(this);
                this.PersonInCharge = fn(this.mydata, "0");
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                getDicValue: function (row, column, cellValue, index) {
                    if (cellValue) {
                        if (typeof cellValue === 'string' || typeof cellValue === 'number') {
                            return getTreeValue(this.mydata, cellValue)
                        }
                        else {
                            var result = '';
                            for (var i = 0; i < cellValue.length; i++) {
                                result += getTreeValue(this.mydata, cellValue[i]) + ',';
                            }
                            result = result.substr(0, result.length - 1);
                            return result;
                        }
                    }

                },
                closeDialog: function () { closeDialog(this); },

                //列表选择触发
                handleSelectionChange: function (val) { handleSelectionChange(this, val); },

                //获取分页数据
                GetPageData: function (currentIndex) { GetPageData(this, currentIndex, '/api/RiskContent/GetRiskData') },
                //查询方法
                onSubmit: function () { onSubmit(this); },
                //pagesize改变 触发方法
                handleSizeChange: function (val) { handleSizeChange(this, val); },
                //跳页触发方法
                handleCurrentChange: function (val) { handleCurrentChange(this, val); },
                //序号排列方法
                indexMethod: function (index) { return (this.ListItem.currentPage - 1) * this.ListItem.pagesize + index + 1; },
            }
        });

    </script>
</body>

</html>